//
//  ZSHomeViewController.m
//  ZhuShou
//
//  Created by Dejun Liu on 15/10/28.
//  Copyright © 2015年 jw. All rights reserved.
//

#import "ZSHomeViewController.h"
#import "ZSLoginViewController.h"
#import "ZSHomeGridViewController.h"
#import "ZSHomeBannerViewController.h"

@interface ZSHomeViewController ()

@end

@implementation ZSHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //登录
    ZSLoginViewController *login = [[ZSLoginViewController alloc] init];
    UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:login];
    [self presentViewController:navi animated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (void)initViews
{
    [super initViews];
    ZSHomeBannerViewController *bannerVC = [[ZSHomeBannerViewController alloc] init];
    [self addChildViewController:bannerVC];
    bannerVC.view.width = self.view.width;
    bannerVC.view.height = 150.0f;
    [self.view addSubview:bannerVC.view];
    
    
    ZSHomeGridViewController *gridVC = [[ZSHomeGridViewController alloc] init];
    [self addChildViewController:gridVC];
    gridVC.view.top = bannerVC.view.bottom;
    gridVC.view.width = self.view.width;
    gridVC.view.height = self.view.height - bannerVC.view.height;
    [self.view addSubview:gridVC.view];
}

@end
